package ar.edu.unq.wannaplay.pages.project;

import ar.edu.unq.wannaplay.dtos.ProjectDTO;
import ar.edu.unq.wannaplay.pages.WPPage;
import ar.edu.unq.wannaplay.panels.project.EditProjectPanel;
import ar.edu.unq.wannaplay.services.ProjectService;
import ar.edu.unq.wannaplay.utils.ProjectEditer;

public class EditProjectPage extends WPPage {

    private ProjectEditer modelObject;

    private ProjectService service;

    public EditProjectPage(final ProjectDTO modelObject, final ProjectService service) {
        super("Edit Project Page");
        this.modelObject = new ProjectEditer(modelObject);
        this.service = service;
        this.initialize();
    }

    public EditProjectPage(final ProjectEditer modelObject, final ProjectService service, final String name) {
        super(name);
        this.modelObject = modelObject;
        this.service = service;
        this.initialize();
    }

    public EditProjectPage(final ProjectEditer modelObject, final ProjectService service) {
        super("Edit Project Page");
        this.modelObject = modelObject;
        this.service = service;
        this.initialize();
    }

    @Override
    protected void addMainContent() {
        EditProjectPanel panel = new EditProjectPanel("mainContent", modelObject, service, this.getFeedBackPanel());
        this.add(panel);
    }

    public ProjectService getService() {
        return service;
    }

    public ProjectEditer getModelObject() {
        return modelObject;
    }

    public void setModelObject(final ProjectEditer modelObject) {
        this.modelObject = modelObject;
    }

    public void setService(final ProjectService service) {
        this.service = service;
    }

}
